<template>
	<view class="content">
		<view class="kecheng">
			<view class="kecheng2">
				<text>课时订单</text>
				<view class="kecheng2-1" @click="kc" data-stu='0'>
					全部<image src="../../static/right_2.png" mode="aspectFill"></image>
				</view>
			</view>
			<view class="kecheng3">
				<view class="kecheng3-1" @click="kc" data-stu='0'>
					<image src="../../static/images/order_1.png" mode="aspectFit"></image>
					<view class="kecheng3-1-1">全部</view>
				</view>
				<view class="kecheng3-1" @click="kc" data-stu='1'>
					<image src="../../static/images/order_2.png" mode="aspectFit"></image>
					<view class="kecheng3-1-1">待付款</view>
					<view class="jiaobiao" v-if="kecheng.dfk_count>0"><text>{{kecheng.dfk_count}}</text></view>
				</view>
				<view class="kecheng3-1" @click="kc" data-stu='2'>
					<image src="../../static/images/order_3.png" mode="aspectFit"></image>
					<view class="kecheng3-1-1">待上课</view>
					<view class="jiaobiao" v-if="kecheng.dsk_count>0"><text>{{kecheng.dsk_count}}</text></view>
				</view>
				<view class="kecheng3-1" @click="kc" data-stu='3'>
					<image src="../../static/images/order_4.png" mode="aspectFit"></image>
					<view class="kecheng3-1-1">待完成</view>
					<view class="jiaobiao" v-if="kecheng.dwc_count>0"><text>{{kecheng.dwc_count}}</text></view>
				</view>
				<view class="kecheng3-1" @click="kc" data-stu='4'>
					<image src="../../static/images/order_5.png" mode="aspectFit"></image>
					<view class="kecheng3-1-1">待评价</view>
					<view class="jiaobiao" v-if="kecheng.dpj_count>0"><text>{{kecheng.dpj_count}}</text></view>
				</view>
			</view>
			
		</view>
		<!--<view class="fengexian"></view>
		<view class="kecheng">
			<view class="kecheng2">
				<text>需求订单</text>
				<view class="kecheng2-1">
					全部<image src="../../static/right_2.png" mode="aspectFill"></image>
				</view>
			</view>
			<view class="kecheng3">
				<view class="kecheng3-1">
					<image src="../../static/images/order_1.png" mode="aspectFit"></image>
					<view class="kecheng3-1-1">全部</view>
				</view>
				<view class="kecheng3-1">
					<image src="../../static/images/order_2.png" mode="aspectFit"></image>
					<view class="kecheng3-1-1">待付款</view>
				</view>
				<view class="kecheng3-1">
					<image src="../../static/images/order_3.png" mode="aspectFit"></image>
					<view class="kecheng3-1-1">待上课</view>
				</view>
				<view class="kecheng3-1">
					<image src="../../static/images/order_4.png" mode="aspectFit"></image>
					<view class="kecheng3-1-1">待完成</view>
				</view>
				<view class="kecheng3-1">
					<image src="../../static/images/order_5.png" mode="aspectFit"></image>
					<view class="kecheng3-1-1">待评价</view>
				</view>
			</view>
			
		</view>-->
		<daohang count='3'></daohang>
	</view>
</template>

<script>
	var app=getApp();
	import daohang from "../../components/daohang.vue"
	export default {
		components: {
			daohang
		},
		data() {
			return {
				uid:0,
				show:0,
				kecheng:[]
			}
		},
		onShow() {
			// #ifdef MP-WEIXIN
			uni.hideHomeButton();
			// #endif
			const uid = uni.getStorageSync('uid');
			if(app.isBlank(uid)==false){
				this.uid=uid;
			}else{
				this.uid=0;
			}
			this.getdata();
		},
		methods: {
			getdata(){
				var that=this;
				
				uni.request({
				    url: app.globalData.url+"laoshi/order",
					method:"POST",
					dataType:"json",
					header: {
					    'content-type': 'application/x-www-form-urlencoded'
					},
				    data: {uid:that.uid},
				    success: (res) => {
						uni.hideLoading();
						if(res.data.code!=1){
							if(res.data.code==-1){
								uni.removeStorageSync('uid');
							}
							app.error_msg(res.data.msg);
						}
						that.kecheng=res.data.data.kecheng
						
						that.show=1;
				    }
				});
			},
			kc(e){
				var id=e.currentTarget.dataset.stu;
				uni.navigateTo({
				    url: '/pages/torder/index?stu='+id
				});
			}
		}
	}
</script>

<style>
	.fengexian{width:100%;height:7px;background-color: #f3f3f3;}
	.jiaobiao text{transform: scale(0.7);font-size: 0.7rem;display: inline-block;}
	.jiaobiao{width:16px;height:16px;border-radius: 50%;background-color: red;color:#fff;text-align: center;line-height: 16px;position: absolute;top:-5px;right:20%;}
	.kecheng3-1-1{width:100%;height:20px;line-height: 16px;}
	.kecheng3-1 image{width:20px;height:20px;}
	.kecheng3-1{width:20%;height:40px;text-align: center;float: left;margin-top: 15px;margin-bottom: 15px;position: relative;}
	.kecheng3{width:100%;overflow: hidden;}
	.kecheng2-1 image{width:16px;height:16px;float: right;margin-top: 13px;}
	.kecheng2-1{display: inline-block;float: right;}
	.kecheng2 text{color:#333;font-weight: 550;}
	.kecheng2{width:94%;padding: 0px 3%;border-bottom: 1px #f3f3f3 solid;height:40px;overflow: hidden;line-height: 40px;}
	.kecheng{width:100%;}
	
</style>
